package com.example.websocket.pattern.behavioral.visitor;

public class Computer implements ComputerPart {

    ComputerPart computerPart[];

    public Computer() {
        computerPart = new ComputerPart[] {new Mouse(), new Keyboard(), new Monitor()};
    }

    @Override
    public void accept(ComputerPartVisitor computerPartVisitor) {
        for (ComputerPart c : computerPart) {
            c.accept(computerPartVisitor);
        }
        computerPartVisitor.visit(this);
    }
}
